import React, {Component} from 'react';
import {connect} from "react-redux";
import {RecommendWrap} from '../style';
// import * as actionCreators from '../../../actions/HomeAction';

class Recommend extends Component {
    render() {
        const {recommendList} = this.props;
        return (
            <div>
                <RecommendWrap>
                    {
                        recommendList.map((item) => {
                            return (
                                <a href="/" key={item.get('id')}>
                                    <img src={item.get('imgUrl')} alt="/" />
                                </a>
                            )
                        })
                    }
                </RecommendWrap>

            </div>
        )
    }

    componentDidMount() {
        // this.props.getRecommendList()
    }
}

const mapStateToProps = (state) => {
    return {
        recommendList: state.getIn(['home', 'recommendList'])
    }
};

// const mapDispatchToProps = (dispatch) => {
//     return {
//         getRecommendList() {
//             dispatch(actionCreators.getRecommendList())
//         }
//     }
// };

export default connect(mapStateToProps, null)(Recommend);